package com.example.mqproduce.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author taritari
 * @date 2023-11-29 16:47
 * @description
 */
@Configuration
public class DirectRabbitMqConfiguration {
//    //声明交换机注册direct模式的交换机
//    @Bean
//    public DirectExchange directExchange(){
//        return new DirectExchange("direct_order_exchange",true,false);
//    }
//    //声明队列 sms.direct.queue email.direct.queue duanxin.direct.queue
//    @Bean
//    public Queue smsQueue(){
//        return new Queue("sms.direct.queue",true);
//    }
//    @Bean
//    public Queue emailQueue(){
//        return new Queue("email.direct.queue",true);
//    }
//    @Bean
//    public Queue duanXinQueue(){
//        return new Queue("duanxin.direct.queue",true);
//    }
//    //完成绑定关系
//    @Bean
//    public Binding smsBingDing(){
//        return BindingBuilder.bind(smsQueue()).to(directExchange()).with("sms");
//    }
//    @Bean
//    public Binding emailBingDing(){
//        return BindingBuilder.bind(emailQueue()).to(directExchange()).with("email");
//    }
//    @Bean
//    public Binding duanXinBingDing(){
//        return BindingBuilder.bind(duanXinQueue()).to(directExchange()).with("duanxin");
//    }
}
